<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			 function test(){
				var a = [];
				for(var i=0; i<10; i++){
					a[i] = function(){
						console.log(i);
					}
				}
				return a;
			}
			var b = test();
			for(var j = 0; j<10; j++){
				b[j]();
			} 
			/* for(var i =0; i<10 ;i++){
				
			} 
			console.log(i);*/
		</script>
	</head>
	<body>
	</body>
</html>
